<?php
session_start();
$welcome=$_SESSION['user'];


//set the values neccessary to connect to the database
$host="localhost";
$username="root";
$password="";
$db="assessmentdb";

//create the connection to the database
$connection=mysql_connect($host, $username, $password);

$assessment=$_POST['assessment'];
$description=$_POST['description'];
$duedate=$_POST['duedate'];
//$duedate=date('y-m-d');


//select my database
$mysel=mysql_select_db($db);

//$duedate=strtotime($duedate)

$query="insert into assessment (username, assessment, duedate, description) values ('$welcome', '$assessment', '$duedate', '$description' )";
$answer=mysql_query($query, $connection);

if($answer)
{
header("location:editassessment.php");

}
else
{
header("location:entry.php");
}



?>